package com.whfc.common.enums;

/**
 * @author sun_guodong
 * @description 特种设备状态的硬件数据
 * @date 2020-05-29
 */

public enum CraneDeviceStatus {
    CRANE_ANTI_COLLISION(111, 101, "特种设备塔吊碰撞报警"),

    CRANE_WEIGHT(12, 102, "特种设备塔吊起重量报警"),
    CRANE_FORCE_MOMENT(13, 103, "特种设备塔吊力矩报警"),
    CRANE_TURN(14, 104, "特种设备塔吊倾角报警"),
    CRANE_WIND_SPEED(15, 105, "特种设备塔吊风速报警"),

    CRANE_RANGE(101, 106, "特种设备塔吊幅度报警"),
    CRANE_HEIGHT_RANGE(102, 107, "特种设备塔吊高度限位报警"),
    CRANE_ROTARY_LIMIT(103, 108, "特种设备塔吊回转限位报警"),

    ;


    private Integer value;
    private Integer ruleType;
    private String desc;

    public Integer getValue() {
        return value;
    }

    public Integer getRuleType() {
        return ruleType;
    }

    public String getDesc() {
        return desc;
    }

    CraneDeviceStatus(Integer value, Integer ruleType, String desc) {
        this.value = value;
        this.ruleType = ruleType;
        this.desc = desc;
    }

    public static CraneDeviceStatus parseByValue(Integer value) {
        switch (value) {
            case 111:
                return CRANE_ANTI_COLLISION;
            case 12:
                return CRANE_WEIGHT;
            case 13:
                return CRANE_FORCE_MOMENT;
            case 14:
                return CRANE_TURN;
            case 15:
                return CRANE_WIND_SPEED;
            case 101:
                return CRANE_RANGE;
            case 102:
                return CRANE_HEIGHT_RANGE;
            case 103:
                return CRANE_ROTARY_LIMIT;

            default:
                return null;
        }
    }

    public static void main(String[] args) {
        System.out.println(0x00000002);
        System.out.println(0x02000000);
    }
}
